// 本题为考试多行输入输出规范示例，无需提交，不计分。
var readline = require('readline');
const rl = readline.createInterface({
  input: process.stdin,
  output: process.stdout,
  terminal: false
});

var n = -1;// 初始状态为负数，表示还没开始读取
var ans = 0;
var cur_line = 0;
rl.on('line', function (line) { // javascript每行数据的回调接口
  if (n < 0) { // 测试用例第一行读取n
    n = parseInt(line.trim())
  } else {
    let map = {}
    let baidustr = 'Baidu'
    for (let char of baidustr) {
      map[char] === undefined ? map[char] = 1 : map[char]++
    }
    // console.log(map); // 所有的字符
    let valid = 0
    let str = line // 读取新的字符串
    if (str.length !== baidustr.length) {
      console.log('No')
    } else {
      let window = {}
      for (let char of str) {
        window[char] === undefined ? window[char] = 1 : window[char]++
        if (window[char] === map[char]) {
          valid++
        }
      }
      if (valid === Object.keys(map).length) {
        console.log('Yes');
      } else {
        console.log('No')
      }
    }

    cur_line += 1;
  }
  if (n === cur_line) {
    // 输出结果
    // 重新初始化相关变量
    n = -1;
    ans = 0;
    cur_line = 0;
  }
});